/**
 * 标准列表
 * @author linfeng
 * @since 2019/12/24
 */
layui.define(['index', 'form', 'table', 'laypage', 'layedit'], function (exports) {
    var $ = layui.$;
    var form = layui.form;
    var layer = layui.layer;
    var table = layui.table;
    var laypage = layui.laypage;
    var zmnExportUtil =layui.zmnExportUtil;

    table.init('zmn-table', {
        toolbar: "#zmn-table-tool",
        page: true,
        defaultToolbar: [],
        limit: json.pageSize,
        height: 'full-165'
    });

    //监听行工具事件
    table.on('tool(zmn-table)', function(obj){
        var relateId = obj.data.relateId;
        if(obj.event === 'delete'){
            layer.confirm('确认删除该城市价格吗？', {
                btn: ['确定', '取消']
            }, function () {
                zmnPage.ajaxSimple("/product/tariff/item/city/price/delete.action", {id: relateId}, 1000);
            });
            return false;
        }
    });

    laypage.render(layui.$.extend({limits:[10, 20, 30, 40, 50,100]},zmnPage.laypageOptions(json)));

    // 区域下拉框联动
    zmnPage.laySelectLinkage(form, "/common/area/listChilds.action", "provinceId", "cityId");

    //对外暴露的接口
    exports('serv_product_tariff_item_city_price_list', {});
});

